package com.example.RxJavaDemo;

import java.util.ArrayList;
import java.util.List;

/**
 * Description :
 *
 * @author WSoBan
 * @date 2018/07/19
 */
public class Student {

    private String id;
    private String name;
    private List<Course> list;

    public Student(String id, String name, List<Course> list) {
        this.id = id;
        this.name = name;
        this.list = list;
    }

    public String getId() {
        return id == null ? "" : id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name == null ? "" : name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Course> getList() {
        if (list == null) {
            return new ArrayList<>();
        }
        return list;
    }

    public void setList(List<Course> list) {
        this.list = list;
    }

    public static class Course {
        private String cname;

        public Course(String cname) {
            this.cname = cname;
        }

        public String getCname() {
            return cname == null ? "" : cname;
        }

        public void setCname(String cname) {
            this.cname = cname;
        }
    }
}
